<div class="content">
  <h1 mat-dialog-title class="title">添加类型</h1>
  <form  #forumTypeForm="ngForm">
    <div mat-dialog-content class="forumType-form">

      <mat-form-field>
        <mat-select placeholder="选择级层" disableRipple [(value)]="category.sjtypeId" [(ngModel)]="category.sjtypeId" name="categorySjtypeId">
          <mat-option value="1">添加父级</mat-option>
          <mat-option value="2">添加子级</mat-option>
        </mat-select>
        <mat-error *ngIf="messages.newsName">{{ messages.newsName }}</mat-error>
      </mat-form-field>
      <br>
      <mat-form-field>
        <mat-select placeholder="选择父级" disableRipple>
          <mat-option *ngFor="let item of categorys" [value]="item.id">
            {{item.newsName}}
          </mat-option>
        </mat-select>
        <mat-error *ngIf="messages.newsName">{{ messages.newsName }}</mat-error>
      </mat-form-field>
      <br>
      <mat-form-field appearance="standard">
        <mat-label>文章类型</mat-label>
        <input matInput required [(ngModel)]="category.newsName" name="newsName">
        <mat-error *ngIf="messages.newsName">{{ messages.newsName }}</mat-error>
      </mat-form-field>

    </div>
    <div mat-dialog-actions class="buttons">
      <button mat-button (click)="onSubmit()">确认</button>
      <button mat-button [mat-dialog-close] cdkFocusInitial>取消</button>
    </div>
  </form>
</div>
